package com.zzq.account.feign.impl;

import com.zzq.account.entities.dto.AccountDTO;
import com.zzq.account.feign.AccountFeign;
import com.zzq.common.result.ResultData;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * @author zzq
 * @date 2020/4/15 9:58 上午
 */
@Component
public class AccountFeignImpl implements FallbackFactory<AccountFeign> {
    @Override
    public AccountFeign create(Throwable throwable) {
        return new AccountFeign() {
            @Override
            public ResultData insert(AccountDTO accountDTO) {
                return ResultData.fail("插入失败");
            }

            @Override
            public ResultData delete(String accountCode) {
                return ResultData.fail("删除失败");
            }

            @Override
            public ResultData update(AccountDTO accountDTO) {
                return ResultData.fail("更新失败");
            }

            @Override
            public ResultData getByCode(String accountCode) {
                return ResultData.fail("获取失败");
            }
        };
    }
}
